'How to call a Jasper report (.jasper) from Phalcon

I have many PHP scripts that call compiled Jasper reports (.jasper), using the PHPJavaBridge. I would like to convert all those scripts to the Phalcon framework, which gets complied into a C executable. Should I continue to use the PHPJavaBridge or is there a better way?

I have plenty of PHP experience but, no experience with Phalcon yet.



Solution 1:[1]

First, you might want to be aware that PhalconPHP Framework is coded in Zephir Lang (Also built and maintenaned by the Phalcon Team). While PHP Frameworks are rarely the bottleneck of your application, it's a pretty good Framework but it will most likely always be your code that will be the bottleneck.

If you want to compile C extensions like PhalconPHP does, you will want to take a look at Zephir Lang:

I know two PHP to Zephir transpiler which you can find on Github, but I wouldn't bet too much on support.

While Zephir C compiled PHP extensions are very powerful, I would suggest building everything on PHP as PHP8+ will give you great performance natively, wider support & compatibility with ease to maintain. If you are facing bottlenecks and slowdowns in some parts of your application, then you may want to use Zephir in order to optimize the performance on those specifics parts of your application.

Zephir was not created to replace PHP or C. Instead, we think it is a complement to them, allowing PHP developers to venture into code compilation and static typing. Zephir is an attempt to join good things from the C and PHP worlds, looking for opportunities to make applications faster.

Also be aware that Zephir needs to be improved and adjusted for new PHP versions which can eventually become a problem if you want to upgrade the PHP version in the future (for new features, security patches etc.)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user1855153