Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Strip objects optimisation #142

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.4.0

Features:

* [joeyhub] Nuked blob, in future objects should not represent types as it gobbles up memory and CPU plus makes the code 10 times larger than it needs to be.

# 1.3.2

Features:
Expand Down
7 changes: 3 additions & 4 deletions ext/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ if test "$PHP_CASSANDRA" != "no"; then
src/Aggregate.c \
src/BatchStatement.c \
src/Bigint.c \
src/Blob.c \
src/Cluster.c \
src/Cluster/Builder.c \
src/Collection.c \
Expand Down Expand Up @@ -268,19 +267,19 @@ if test "$PHP_CASSANDRA" != "no"; then
PHP_ADD_LIBRARY(m,, CASSANDRA_SHARED_LIBADD)

if test "$PHP_CASSANDRA" != "yes"; then
if test -f $PHP_CASSANDRA/include/cassandra.h; then
if test -f $PHP_CASSANDRA/include/cassandra/cassandra.h; then
CPP_DRIVER_DIR=$PHP_CASSANDRA
fi
else
for i in /usr/local /usr; do
if test -f $i/include/cassandra.h; then
if test -f $i/include/cassandra/cassandra.h; then
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs some if then else for handling either situation (see remi merge).

CPP_DRIVER_DIR=$i
fi
done
fi

AC_MSG_CHECKING([for supported DataStax C/C++ driver version])
PHP_CASSANDRA_FOUND_CASSANDRA_VERSION=`$AWK '/CASS_VERSION_MAJOR/ {printf $3"."} /CASS_VERSION_MINOR/ {printf $3"."} /CASS_VERSION_PATCH/ {printf $3}' $CPP_DRIVER_DIR/include/cassandra.h`
PHP_CASSANDRA_FOUND_CASSANDRA_VERSION=`$AWK '/CASS_VERSION_MAJOR/ {printf $3"."} /CASS_VERSION_MINOR/ {printf $3"."} /CASS_VERSION_PATCH/ {printf $3}' $CPP_DRIVER_DIR/include/cassandra/cassandra.h`
PHP_CASSANDRA_FOUND_CASSANDRA_VERSION_NUMBER=`echo "${PHP_CASSANDRA_FOUND_CASSANDRA_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 100 + [$]2) * 100 + [$]3;}'`
if test "$PHP_CASSANDRA_FOUND_CASSANDRA_VERSION_NUMBER" -lt "20700"; then
AC_MSG_ERROR([not supported. Driver version 2.7.0+ required (found $PHP_CASSANDRA_FOUND_CASSANDRA_VERSION)])
Expand Down
1 change: 0 additions & 1 deletion ext/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ if (PHP_CASSANDRA != "no") {
"Aggregate.c " +
"BatchStatement.c " +
"Bigint.c " +
"Blob.c " +
"Cluster.c " +
"Collection.c " +
"Column.c " +
Expand Down
61 changes: 0 additions & 61 deletions ext/doc/Cassandra/Blob.php

This file was deleted.

1 change: 0 additions & 1 deletion ext/doc/Cassandra/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
* @see Bigint
* @see Smallint
* @see Tinyint
* @see Blob
* @see Collection
* @see Float
* @see Inet
Expand Down
3 changes: 0 additions & 3 deletions ext/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ protocol and Cassandra Query Language v3.
<file role="src" name="src/BatchStatement.c" />
<file role="src" name="src/Bigint.c" />
<file role="src" name="src/Bigint.h" />
<file role="src" name="src/Blob.c" />
<file role="src" name="src/Blob.h" />
<file role="src" name="src/Cluster.c" />
<file role="src" name="src/Cluster/Builder.c" />
<file role="src" name="src/Collection.c" />
Expand Down Expand Up @@ -194,7 +192,6 @@ protocol and Cassandra Query Language v3.
<file role="doc" name="doc/Cassandra/Aggregate.php" />
<file role="doc" name="doc/Cassandra/BatchStatement.php" />
<file role="doc" name="doc/Cassandra/Bigint.php" />
<file role="doc" name="doc/Cassandra/Blob.php" />
<file role="doc" name="doc/Cassandra/Cluster.php" />
<file role="doc" name="doc/Cassandra/Cluster/Builder.php" />
<file role="doc" name="doc/Cassandra/Collection.php" />
Expand Down
2 changes: 0 additions & 2 deletions ext/php_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ static PHP_GINIT_FUNCTION(php_driver)
php_driver_globals->persistent_sessions = 0;
PHP5TO7_ZVAL_UNDEF(php_driver_globals->type_varchar);
PHP5TO7_ZVAL_UNDEF(php_driver_globals->type_text);
PHP5TO7_ZVAL_UNDEF(php_driver_globals->type_blob);
PHP5TO7_ZVAL_UNDEF(php_driver_globals->type_ascii);
PHP5TO7_ZVAL_UNDEF(php_driver_globals->type_bigint);
PHP5TO7_ZVAL_UNDEF(php_driver_globals->type_smallint);
Expand Down Expand Up @@ -485,7 +484,6 @@ PHP_MINIT_FUNCTION(php_driver)
php_driver_define_Bigint(TSRMLS_C);
php_driver_define_Smallint(TSRMLS_C);
php_driver_define_Tinyint(TSRMLS_C);
php_driver_define_Blob(TSRMLS_C);
php_driver_define_Decimal(TSRMLS_C);
php_driver_define_Float(TSRMLS_C);
php_driver_define_Inet(TSRMLS_C);
Expand Down
2 changes: 1 addition & 1 deletion ext/php_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#endif

#include <gmp.h>
#include <cassandra.h>
#include <cassandra/cassandra.h>

/* Ensure Visual Studio 2010 does not load MSVC++ stdint definitions */
#ifdef _WIN32
Expand Down
9 changes: 0 additions & 9 deletions ext/php_driver_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

#if PHP_MAJOR_VERSION >= 7
#define PHP_DRIVER_GET_NUMERIC(obj) php_driver_numeric_object_fetch(Z_OBJ_P(obj))
#define PHP_DRIVER_GET_BLOB(obj) php_driver_blob_object_fetch(Z_OBJ_P(obj))
#define PHP_DRIVER_GET_TIMESTAMP(obj) php_driver_timestamp_object_fetch(Z_OBJ_P(obj))
#define PHP_DRIVER_GET_DATE(obj) php_driver_date_object_fetch(Z_OBJ_P(obj))
#define PHP_DRIVER_GET_TIME(obj) php_driver_time_object_fetch(Z_OBJ_P(obj))
Expand Down Expand Up @@ -76,7 +75,6 @@
#define PHP_DRIVER_GET_DURATION(obj) php_driver_duration_object_fetch(Z_OBJ_P(obj))
#else
#define PHP_DRIVER_GET_NUMERIC(obj) ((php_driver_numeric *)zend_object_store_get_object((obj) TSRMLS_CC))
#define PHP_DRIVER_GET_BLOB(obj) ((php_driver_blob *)zend_object_store_get_object((obj) TSRMLS_CC))
#define PHP_DRIVER_GET_TIMESTAMP(obj) ((php_driver_timestamp *)zend_object_store_get_object((obj) TSRMLS_CC))
#define PHP_DRIVER_GET_DATE(obj) ((php_driver_date *)zend_object_store_get_object((obj) TSRMLS_CC))
#define PHP_DRIVER_GET_TIME(obj) ((php_driver_time *)zend_object_store_get_object((obj) TSRMLS_CC))
Expand Down Expand Up @@ -160,11 +158,6 @@ PHP_DRIVER_BEGIN_OBJECT_TYPE(time)
cass_int64_t time;
PHP_DRIVER_END_OBJECT_TYPE(time)

PHP_DRIVER_BEGIN_OBJECT_TYPE(blob)
cass_byte_t *data;
size_t size;
PHP_DRIVER_END_OBJECT_TYPE(blob)

PHP_DRIVER_BEGIN_OBJECT_TYPE(uuid)
CassUuid uuid;
PHP_DRIVER_END_OBJECT_TYPE(uuid)
Expand Down Expand Up @@ -517,7 +510,6 @@ extern PHP_DRIVER_API zend_class_entry *php_driver_numeric_ce;
extern PHP_DRIVER_API zend_class_entry *php_driver_bigint_ce;
extern PHP_DRIVER_API zend_class_entry *php_driver_smallint_ce;
extern PHP_DRIVER_API zend_class_entry *php_driver_tinyint_ce;
extern PHP_DRIVER_API zend_class_entry *php_driver_blob_ce;
extern PHP_DRIVER_API zend_class_entry *php_driver_decimal_ce;
extern PHP_DRIVER_API zend_class_entry *php_driver_float_ce;
extern PHP_DRIVER_API zend_class_entry *php_driver_inet_ce;
Expand Down Expand Up @@ -570,7 +562,6 @@ void php_driver_define_Numeric(TSRMLS_D);
void php_driver_define_Bigint(TSRMLS_D);
void php_driver_define_Smallint(TSRMLS_D);
void php_driver_define_Tinyint(TSRMLS_D);
void php_driver_define_Blob(TSRMLS_D);
void php_driver_define_Collection(TSRMLS_D);
void php_driver_define_Decimal(TSRMLS_D);
void php_driver_define_Float(TSRMLS_D);
Expand Down
Loading